Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: evm signer - tryprocessout #1809

Merged
merged 29 commits into from
Mar 7, 2024
Merged

refactor: evm signer - tryprocessout #1809

merged 29 commits into from
Mar 7, 2024

Conversation

kevinssgh
Copy link
Contributor

@kevinssgh kevinssgh commented Feb 26, 2024

Description

Refactored the tryprocessout interface int the evm signer. The function was broken into 3 parts:

  • Input setup
  • Transaction signing
  • Broadcasting

A new data structure was introduced to store the required inputs for all transaction types. Signatures were simplified using the new struct.

Some input validation and setup was moved to another function as well.

Closes: #1770

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 60.63348% with 87 lines in your changes are missing coverage. Please review.

Project coverage is 42.97%. Comparing base (9c1139e) to head (b2fe4d3).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1809      +/-   ##
===========================================
+ Coverage    40.77%   42.97%   +2.19%     
===========================================
  Files          216      217       +1     
  Lines        12780    12792      +12     
===========================================
+ Hits          5211     5497     +286     
+ Misses        7173     6852     -321     
- Partials       396      443      +47     
Files Coverage Δ
zetaclient/evm/outbound_transaction_data.go 69.33% <69.33%> (ø)
zetaclient/evm/evm_signer.go 45.84% <56.16%> (+45.84%) ⬆️

... and 1 file with indirect coverage changes

@kevinssgh kevinssgh marked this pull request as ready for review February 29, 2024 20:56
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer_test.go Outdated Show resolved Hide resolved
zetaclient/testutils/mock/mock_core_bridge.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
@kevinssgh kevinssgh requested a review from lumtis March 1, 2024 20:38
@lumtis
Copy link
Member

lumtis commented Mar 4, 2024

@ws4charlie can you please have a look in this PR sometime today?

zetaclient/testutils/stub/mock_core_bridge.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Show resolved Hide resolved
zetaclient/evm/evm_signer.go Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
zetaclient/evm/base_transaction_data.go Outdated Show resolved Hide resolved
zetaclient/evm/base_transaction_data.go Outdated Show resolved Hide resolved
@kevinssgh kevinssgh requested a review from lumtis March 4, 2024 21:32
Copy link
Contributor

@ws4charlie ws4charlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a few minor comments

@kevinssgh kevinssgh requested a review from ws4charlie March 5, 2024 20:29
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, setTransactionData needs more tests, and I think we should discuss #1809 (comment)

zetaclient/evm/outbound_transaction_data_test.go Outdated Show resolved Hide resolved
zetaclient/evm/evm_signer.go Outdated Show resolved Hide resolved
@kevinssgh kevinssgh requested a review from lumtis March 6, 2024 18:37
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lumtis lumtis merged commit 09f99eb into develop Mar 7, 2024
21 checks passed
@lumtis lumtis deleted the refactor-tryprocessout branch March 7, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

evm signer - simplify TryProcessOutTx, long function
3 participants